package com.sy.core.aliPay;
import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2019090366873323";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCkw5irJXBNRab9S1rykBhN7AH1bD8qRzcQaWhgHCSWQId3kj4AmDonxAKuAUa6AyyVPPXb9AiBNccS7W5+zbR3YvhmhxWDDZ6G+T1nopVm1QRZOexVgSGeypXK94i+gOxWzJRVFnpJ4NrWJl83IwiuVmqxBRy6TlE/m1sFbA2pH4nMs99rjcBDcn5LifscNbCjI+mAC7bMSeqzutcPn9coSVLvu/PZ8PZhLCUwwyn1mndwNll57fDjh4Sp0XkivLRMEWaIhe1wSZk+KOl0sJPuV0FuQueKrAHIUwkzxwXO6Gwh2Sawx077GxNEU7Bj+GsOr4fYmg57fPgrxMF6lfAxAgMBAAECggEAGTDekqwys13G3ks7KILndGJ1GjTmo2wn+xZiou8qmN5c1+dAG48qtRG+5yPC0IXTty2O2YZCFp9GRJqQnkqNIQO8vtBAdb0LU8+fl8y/0u0WsR2uCJSps0F+DX4zJg1IFS1KMIgzQkBitQNA44kztpP31ADYF5QJ0BPMotOWcxjjesJsmS1QRMCXWLSJ/IyutsgbIu5MAgnw2YDofk024Q79PfCCFis0iQhjXwGqjHNyoAB83fXxyELbrv9Z/d18cisglPmqmMeDNwWh1vjsVVPwUv2BafgZ1oHfp8RxQrpXk99uQCg8EvA+NC8QrT9s1sGXmYvMDPqmyeJYuowCEQKBgQD2hTHZzM3JQ5L5mmT18MnP3hN0/AfnlmlE/SeF1jAd7cVbWY4oWAoMhJGAFHfmFwvB7AeNZAIGmfybDaTGPnhpoW5+8J5hL5mpbLIKH6WMs4oLUcknESUG6zSBwnmBv3yRiGpf9bVOhi1okMU5QZF7Lb21v+ul+OOmbXT3UOix3wKBgQCrGZLMZph6+8NpeY2Zh6LGnxPhexZVfKY4RqBY6MKtHIZCRJUDCJAUksuWGm2QJ8fcKQwHS+lDwRhaSM7BeXxWh7JEE+maSw6sGZfB4mlFNHViFSxG+kFJlwU7Q9LArvVz1g9foDtIbHAkM3kVobw3kHRd0eAI1dG8uoBeOK4/7wKBgCMPtJRejZInezrm258jHQDke+3yfolQmi5Gtx1Q5k0LaTth1Fcmll9LZ4pI3vippHFzSWuxopwfwI6o9RuA/Q1A+X8yZ8Q4yekP3Y6VC62kR2juu+ZDiPmf8DrYVwG+I1Brj32Qa7X8XW720CYhjjhvvACiiDh12qLsBGu8ZSwPAoGAatTU6/tDScbZBIp491vRLuM0rp0EHOxvfMPcaqcqppwg2E+qGvLFw5LEuzxVHKU6DSUz9XpYc42lfvnm3rbUA9NGY2treINU7fAs6UpNIIDYqh0+QDMRgLli8tYuSVD0wRbvEm4hld7fRjs9Z1xNAQSZI9tfXyTiiEyKyknpwtECgYB3tkpYQTZMCdkuxlEopCdDuR3/PUBm77fE5tWKc5EfwDuW2j5gB0StJb/EHxvPijnWaf/8HAxTAle2P9CmPM183BQ3Iie3tiSruu6iyiVafwv9CuBSr7cFHUwr3gT16Tpce7jRT5WLYUe4rTIh9h0F9jpT6+2n4+iyfE8uqMR7+w==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgiocqixP3jzMMt4MpPsvwsuUKbVamwWpFPAyxRvdtmu/F6L0xOscu4qH6g6C6ApYlE4DC9tvdH+NGe4t8Ea4+PUtjlFoIQ+rf6sWAbLOcRQU3UeCURdPL3fnF9NTXIh05JxYg/LJNxCMWyAcSV8vjRFDWgqMO1Th6wyITrSfkiEyqivn92sORgLzNN6fqYyLuOpxACYEV8CiHZNNsfp2L0uUG/A7fmGSvhRSZYH3CYyz/4vVI8guOnj9J7z+bSnD+E4HUex+gohi/g0oDS4bM35bn2fR+Yrp3IN48lAxiATF9zW1/pae6iZ3XX72Rif4SeADVYq+SHWoIKmlbPjH5QIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = " http://keyic.cn/returnPay/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = " http://keyic.cn/returnPay/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
